<?php $this->load->view('base/header');?>

<script src="<?php echo base_url()?>js/iphone/iphone-style-checkboxes.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="<?php echo base_url()?>css/iphone/checkbox.css" type="text/css" media="screen" charset="utf-8" />

<link rel="stylesheet" media="screen" href="<?php echo base_url().'css/jquery.datatable.gui.css'?>"/>
<link rel="stylesheet" media="screen" href="<?php echo base_url().'css/jquery-ui-1.8.14.custom.css'?>"/>

<script type="text/javascript" src="<?php echo base_url().'js/jquery-ui-1.8.14.custom.min.js'?>"></script>
<script type="text/javascript" src="<?php echo base_url().'js/jquery.dataTables.js'?>"></script>
<script type="text/javascript" src="<?php echo base_url().'js/jquery.dataTables.ajaxPlugin.js'?>"></script>
<script type="text/javascript" src="<?php echo base_url().'js/crud/barang.js'?>"></script>

<script type="text/javascript" charset="utf-8">
    $(window).load(function() {
        $('.:checkbox').iphoneStyle({ checkedLabel: 'Toko         &nbsp;', uncheckedLabel: 'Non Toko' });
    });
</script>

<section>
    <div class="container_8 clearfix">

        <!-- Main Section -->

        <section class="main-section grid_8">

            <!-- Statistics Section -->
            <div class="main-content">
                <header>
                    <h2>
                        Tabel Master
                    </h2>
                </header>
                <section class="container_6 clearfix">
                    <div class="grid_6">
                        <h3>Tabel barang
                            <?php $this->load->view('crud/navigation');?>
                        </h3>
                        <div style="float: left;">
                            <input type="checkbox" checked="checked" id="FILTER_MODE_TOKO"/><br/>
                        </div>
                        <div id="FILTER_TOKO" style="float: left; margin-left: 20px">
                            <select id="ID_TOKO" name="ID_TOKO">
                                <?php foreach($Toko->result() as $row):?>
                                <option value="<?php echo $row->ID_TOKO?>"><?php echo $row->NAMA_TOKO?>&nbsp;</option>
                                <?php endforeach;?>
                            </select>
                        </div>
                        <div style="float: right; margin: 0 5px 3px 0;">
                            <button class="button button-gray" id="barang_add">
                                <span class="add"></span>
                                Add
                            </button>
                        </div>
                        <div id="dialog-barang">
                            <table id="barang_master" width="100%" class="datatable">
                                <thead>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </section>

                <div id="dialog-barang-form">
                    <form id="barang_form" class="form" method="post">
                        <div style="float: left">
                            <!--<div class="clearfix">
                                <label>Kode Barang<em>*</em></label>
                                <input type="text" id="KODE_BARANG" name="KODE_BARANG" required="required" value=""/>
                            </div>-->

                            <div class="clearfix toko">
                                <label>Pemilik Barang<em>*</em></label>
                                <select id="PEMILIK_BARANG" name="PEMILIK_BARANG">
                                    <option value="Barang Toko">Barang Toko</option>
                                    <option value="Barang Titipan">Barang Titipan</option>
                                    <option value="Barang Suplier">Barang Suplier</option>
                                </select>
                            </div>

                            <div class="clearfix non-toko">
                                <label>Jenis Barang<em>*</em></label>
                                <select id="ID_JENIS_BARANG" name="ID_JENIS_BARANG">
                                    <?php foreach($JenisBarang->result() as $row):?>
                                    <option value="<?php echo $row->ID_JENIS_BARANG?>"><?php echo $row->NAMA_JENIS_BARANG?></option>
                                    <?php endforeach;?>
                                </select>
                            </div>

                            <div class="clearfix">
                                <label>Nama Barang<em>*</em></label>
                                <input type="text" id="NAMA_BARANG" name="NAMA_BARANG" value=""/>
                            </div>

                            <div class="clearfix">
                                <label>Merk</label>
                                <input type="text" id="MERK" name="MERK" value=""/>
                            </div>

                            <div class="clearfix">
                                <label>Satuan</label>
                                <select id="NAMA_SATUAN" name="NAMA_SATUAN">
                                    <?php foreach($Satuan->result() as $row):?>
                                    <option value="<?php echo $row->NAMA_SATUAN?>"><?php echo $row->NAMA_SATUAN?></option>
                                    <?php endforeach;?>
                                </select>
                            </div>

                        </div>

                        <div style="float: left">

                            <div class="clearfix">
                                <label>Harga Beli</label>
                                <input type="text" id="HARGA_BELI" name="HARGA_BELI" value=""  />
                            </div>
                            <div class="toko">
                                <div class="clearfix">
                                    <label>Harga Jual</label>
                                    <input type="text" id="HARGA_JUAL" name="HARGA_JUAL" value=""  />
                                </div>
                                <div class="clearfix">
                                    <label>Saldo Awal</label>
                                    <input type="text" id="JUMLAH_AWAL" name="JUMLAH_AWAL" value=""  maxlength="6" size="6" style="width: 53px;"/>
                                </div>
                                <div class="clearfix">
                                    <label>Stok Minimal</label>
                                    <input type="text" id="STOK_MIN" name="STOK_MIN" value=""  maxlength="6" size="6" style="width: 53px;"/>
                                </div>
                                <div class="clearfix">
                                    <label>Saldo Akhir</label>
                                    <input type="text" id="JUMLAH_AKHIR" name="JUMLAH_AKHIR" value=""  maxlength="6" size="6" style="width: 53px;"/>
                                </div>
                            </div>
                            <div class="clearfix">
                                <label>Diskon</label>
                                <input type="text" id="DISKON" name="DISKON" value=""  maxlength="4" size="4" style="width: 33px;"/>
                            </div>
                        </div>

                        <div class="action clearfix">
                            <button class="button button-gray" id="add_submit" type="submit"><span class="accept"></span>Add</button>
                            <button class="button button-gray" id="update_submit" type="submit"><span class="accept"></span>Update</button>
                            <button class="button button-gray" type="reset">Reset</button>
                        </div>
                    </form>
                </div>

            </div>
            <!-- End Statistics Section -->

        </section>

        <!-- Main Section End -->

    </div>
</section>
</div>

<?php $this->load->view('base/footer');?>
